CKM_AES_CTR
This section provides a summary of CKM_AES_CTR.
Note
This mechanism is only available if you are using PTK 7.2.0 or newer with ProtectServer 3 HSM Firmware 7.02.00 or newer.
Supported Operations
Operation | Supported |
---|---|
Encrypt and Decrypt | Yes (Single-part and multi-part operations) |
Sign and Verify | No |
SignRecover and VerifyRecover | No |
Digest | No |
Generate Key/Key-Pair | No |
Wrap and Unwrap | No |
Derive | No |
FIPS Mode support
Available in FIPS Mode | Restrictions in FIPS Mode |
---|---|
Yes* | None |
*Except when using ProtectServer 3 HSM Firmware 7.02.02
Key Size Range (bytes) and Parameters
Key Size Minimum/Maximum | Value |
---|---|
Minimum | 16 |
FIPS Minimum | 16 |
Maximum | 32 |
Parameter
CK_AES_CTR_PARAMS
Mechanism Description
Generic AES counter mode is described in NIST Special Publication 800-38A and RFC 3686. These describe encryption using a counter block that may include a nonce to guarantee uniqueness of the counter block. Since the nonce is not incremented, the mechanism parameter must specify the number of counter bits in the counter block.
The block counter is incremented by 1 after each block of plaintext is processed. There is no support for any other increment functions in this mechanism.
If an attempt to encrypt/decrypt is made that will cause an overflow of the counter block’s counter bits, then the mechanism shall return CKR_DATA_LEN_RANGE.
Note
The mechanism will allow the final post increment of the counter to overflow but not allow any further processing after this point. For example, if ulCounterBits = 8 and the counter bits start as 0xff, then only 1 block of data can be processed.
CK_AES_CTR_PARAMS is a structure that provides the parameters to the CKM_AES_CTR mechanism. It is defined as follows:
typedef struct CK_AES_CTR_PARAMS {
CK_ULONG ulCounterBits;
CK_BYTE cb[16];
} CK_AES_CTR_PARAMS;
ulCounterBits specifies the number of bits in the counter block (cb) that shall be incremented. This number shall be such that 0 < ulCounterBits< = 128 and ulCounterBits % 8 = 0. For any values outside this range, the mechanism shall return CKR_MECHANISM_PARAM_INVALID.
It's up to the caller to initialize all of the bits in the counter block including the counter bits. The counter bits are the least significant bits of the counter block (cb). They are a big-endian value usually starting with 1.
Return to ProtectToolkit-C mechanisms.